package org.bennedum.SimpleMCClient.protocol;

/**
 *
 * @author frdfsnlght <frdfsnlght@gmail.com>
 */
public final class Packet0D extends Packet {
    
    public Packet0D(byte[] input) {
        setBuffer(input, 0, 42);
    }
 
    public Packet0D(double x, double y, double z, double stance, float yaw, float pitch, boolean onGround) {
        super(0x0D, 42);
        setDouble(buffer, 1, x);
        setDouble(buffer, 9, y);
        setDouble(buffer, 17, stance);
        setDouble(buffer, 25, z);
        setFloat(buffer, 33, yaw);
        setFloat(buffer, 37, pitch);
        setBoolean(buffer, 41, onGround);
    }
    
    public double getX() {
        return getDouble(buffer, 1);
    }
    
    public double getCtSY() {
        return getDouble(buffer, 9);
    }
    
    public void setCtSY(double v) {
        setDouble(buffer, 9, v);
    }
    
    public double getStCStance() {
        return getDouble(buffer, 9);
    }
    
    public double getCtSStance() {
        return getDouble(buffer, 17);
    }
    
    public void setCtSStance(double v) {
        setDouble(buffer, 17, v);
    }
    
    public double getStCY() {
        return getDouble(buffer, 17);
    }
    
    public double getZ() {
        return getDouble(buffer, 25);
    }
    
    public float getYaw() {
        return getFloat(buffer, 33);
    }
    
    public float getPitch() {
        return getFloat(buffer, 37);
    }
    
    public boolean getOnGround() {
        return getBoolean(buffer, 41);
    }
    
}
